#ifndef MQTT_H
#define MQTT_H

#include "MQTTClient.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pthread.h"

#define ADDRESS         "tcp://192.168.0.214:1883"  // 服务器地址
#define PUB_CLIENT      "ExampleClientPub"          // 发布端客户端ID
#define SUB_CLIENT      "ExampleClientSub"          // 订阅端客户端ID
#define PUB_TOPIC       "/app/data/up"              // 数据上报主题
#define SUB_TOPIC       "/app/control/down"         // 控制指令主题
#define QOS        1                           // 服务质量等级
#define TIMEOUT    10000L                      // 超时时间（毫秒）

void delivered(void *context, MQTTClient_deliveryToken dt);
//int msgarrvd(void *context, char *topicName, int topicLen, MQTTClient_message *message);
void connlost(void *context, char *cause);
int mqtt_publish(MQTTClient client, const char* payload);




#endif

